package com.fanghuaiming.test.c4.多路复用;

import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.channels.SocketChannel;
import java.nio.charset.Charset;

/****
 * @description:
 * @version:1.0.0
 * @author fanghuaiming
 * @data Created in 2021/9/21 下午4:45
 *
 */
public class Client {

  public static void main(String[] args) throws IOException {
      SocketChannel sc = SocketChannel.open();
      sc.connect(new InetSocketAddress("localhost",8080));
      //sc.write(Charset.defaultCharset().encode("hello\nworld\n"));
      sc.write(Charset.defaultCharset().encode("1234567890de1231243\nworld\n"));
      System.in.read();
  }
}
